﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CSharpProjectLayers.DAL;
using CSharpProjectLayers.Models;

namespace CSharpProjectLayers.BLL
{
    /// <summary>
    /// 员工信息业务类
    /// </summary>
    public class EmployeeManager
    {
        private EmployeeService employeeService = new EmployeeService();
        //这么多参数，使用起来非常不便利
        /*public int AddEmployee(string EployName, string gender, string NowAddress, string IdNo, string WeiXinNumber, string PhoneNumber, string OtherWork, DateTime EntryDate, int PostId, int DepartmentId)
        {
            return employeeService.AddEmployee(EployName, gender, NowAddress, IdNo, WeiXinNumber, PhoneNumber,OtherWork,  EntryDate, PostId, DepartmentId);
        }*/

        /// <summary>
        /// 添加员工对象
        /// </summary>
        /// <param name="employee"></param>
        /// <returns></returns>
        public int AddEmployee(Employee employee)
        {
            return employeeService.AddEmployee(employee);
        }
        /// <summary>
        /// 根据部门查询员工信息
        /// </summary>
        /// <param name="DepartmentId">部门编号</param>
        /// <returns></returns>
        public List<Employee> QueryEmployeeByDepartmentId(string DepartmentId)
        {
            return employeeService.QueryEmployeeByDepartmentId(DepartmentId);
        }
    }
}
